﻿@using MyResources = Commission.Resources.AppResource

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - @MyResources.AppName</title>
    @Styles.Render("~/Content/css")
    @Styles.Render("~/Content/themes/base/css")
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/jquery")

    <script type="text/javascript">
        Url = function() { }
        Url.prototype = {
            _relativeRoot: '<%= ResolveUrl("~/") %>',
            // create an extension method called "resolve"
            resolve: function(relative) {
                var resolved = relative;

                if (relative.charAt(0) == '~')
                    resolved = this._relativeRoot + relative.substring(2);

                return resolved;
            }
        }
        $Url = new Url();
    </script>

    @if (IsSectionDefined("MyJavascript"))
    {
        @RenderSection("MyJavascript");
    }

    @if (IsSectionDefined("Sortable"))
    {
        @RenderSection("Sortable");
    }

    <style type="text/css">
        ul.nav li.dropdown:hover > ul.dropdown-menu {
            display: block;
        }
    </style>
</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink(@MyResources.LabelCompanyName, "Index", "Home", null, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>@Html.ActionLink(@MyResources.LinkHome, "Index", "Home")</li>

                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            @MyResources.LabelCustomerManagement<b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            <li>@Html.ActionLink(@MyResources.LabelCustomerList, "Index", "Customer")</li>
                            <li>@Html.ActionLink(@MyResources.LinkTrading, "Trading", "Product")</li>
                        </ul>
                    </li>

                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            @MyResources.LabelBudget<b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            @if (!User.IsInRole("Admin"))
                            {
                                <li>@Html.ActionLink(@MyResources.LinkWithdraw, "Withdraw", "Transaction")</li>
                            }
                            else
                            {
                                <li>@Html.ActionLink(@MyResources.LinkInputAmount, "InputAmount", "Transaction")</li>
                            }
                            <li>@Html.ActionLink(@MyResources.LinkWithdrawList, "WithdrawList", "Transaction")</li>
                        </ul>
                    </li>

                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            @MyResources.LabelBonus<b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            <li>@Html.ActionLink(@MyResources.LinkAccountList, "Index", "Transaction")</li>
                            <li>@Html.ActionLink(@MyResources.LinkAccountSumList, "SumIndex", "Transaction")</li>
                            <li>@Html.ActionLink(@MyResources.LinkAmountDetail, "AmountDetail", "Transaction")</li>
                        </ul>
                    </li>

                    <li style="width:80px">@Html.ActionLink(@MyResources.LinkChart, "Chart", "Home")</li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            @MyResources.LinkProduct<b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            <li>@Html.ActionLink(@MyResources.LinkList, "Index", "Product")</li>

                            @if (User.IsInRole("Admin")) {
                                <li>@Html.ActionLink(@MyResources.LinkUpload, "Upload", "Product")</li>
                            }
                            else
                            {
                                <li>@Html.ActionLink(@MyResources.LinkOrder, "Order", "Product")</li>
                            }
                        </ul>
                    </li>
                </ul>
                @Html.Partial("_LoginPartial")
            </div>
        </div>
    </div>
    <div class="container body-content">
        @RenderBody()
        <hr />
    </div>

    <footer>
        &nbsp;&nbsp;&nbsp;<p>&copy; @DateTime.Now.Year - @MyResources.LabelCompanyName</p>
    </footer>


    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
</body>
</html>
